model
Class Individual

java.lang.Object
  extended by model.Individual
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable

public class Individual
extends java.lang.Object
implements java.io.Serializable, java.lang.Runnable

Individual object which simulates each skiier's values and past experience

Author:
See Also:
Serialized Form

Field Summary
 java.util.ArrayList<java.lang.Double> decisionPercent
          Lists of the past and current decision percent
 java.util.ArrayList<java.lang.Double> experience
          Lists of the individual's past and current experience
 java.util.ArrayList<int[]> friends
          Lists of all the current individual's friend
 int ID
          Name of Individual
 int IQ
          Individual's IQ level
 java.util.ArrayList<java.lang.Double> skill
          Lists of the individual's past and current skill level
 java.util.ArrayList<boolean[]> success
          Lists of individual's past success rate
 java.util.ArrayList<java.lang.Double> successpercent
          Lists of the individual's success percent (sum(success)/num_of_iterations)
 java.util.ArrayList<java.lang.Double> weather
          Lists of the past simulation's weather
 java.util.ArrayList<boolean[]> went
          Lists of history if the individual went to the resort
 java.util.ArrayList<java.lang.Double> wentpercent
          Lists of the individual's went percent (sum(went)/num_of_iterations)
 
Constructor Summary
Individual(int ID, int numskiiers, int numweeks, double wmean, double fmean, double smean, double dp, double exp)
          Constructor for Individual
 
Method Summary
 boolean decision(int week, State s)
          Calculates the final decision of the individual
 double friendfactor(int week, State s)
          Calculates friend factor (how much friends effect their final decision)
 void run()
           
 void setvalues(java.util.Random r, int numskiiers, int numweeks, double wmean, double fmean, double smean, double dp, double exp)
          Adds the parameter values to the respective lists
 boolean strategy(int week, State s)
          Calculates if the user decides to go with their IQ level
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ID

public int ID
Name of Individual


friends

public java.util.ArrayList<int[]> friends
Lists of all the current individual's friend


skill

public java.util.ArrayList<java.lang.Double> skill
Lists of the individual's past and current skill level


weather

public java.util.ArrayList<java.lang.Double> weather
Lists of the past simulation's weather


IQ

public int IQ
Individual's IQ level


decisionPercent

public java.util.ArrayList<java.lang.Double> decisionPercent
Lists of the past and current decision percent


experience

public java.util.ArrayList<java.lang.Double> experience
Lists of the individual's past and current experience


went

public java.util.ArrayList<boolean[]> went
Lists of history if the individual went to the resort


success

public java.util.ArrayList<boolean[]> success
Lists of individual's past success rate


successpercent

public java.util.ArrayList<java.lang.Double> successpercent
Lists of the individual's success percent (sum(success)/num_of_iterations)


wentpercent

public java.util.ArrayList<java.lang.Double> wentpercent
Lists of the individual's went percent (sum(went)/num_of_iterations)

Constructor Detail

Individual

public Individual(int ID,
                  int numskiiers,
                  int numweeks,
                  double wmean,
                  double fmean,
                  double smean,
                  double dp,
                  double exp)
Constructor for Individual

Parameters:
ID: - Name of Individual
numskiiers: - Number of skiiers currently on resort
numweeks: - Number of week of the simulation
wmean: - average weather input
fmean: - average number of friends
smean: - average skills
dp: - Decision percent of the simulation
exp: - Current individual's experience
Method Detail

run

public void run()
Specified by:
run in interface java.lang.Runnable

setvalues

public void setvalues(java.util.Random r,
                      int numskiiers,
                      int numweeks,
                      double wmean,
                      double fmean,
                      double smean,
                      double dp,
                      double exp)
Adds the parameter values to the respective lists

Parameters:
r: - Random generator
numskiiers: - Number of skiiers currently on resort
numweeks: - Number of week of the simulation
wmean: - average weather input
fmean: - average number of friends
smean: - average skills
dp: - Decision percent of the simulation
exp: - Experience Percent of the individual

strategy

public boolean strategy(int week,
                        State s)
Calculates if the user decides to go with their IQ level

Parameters:
week: - Number of week the simulation is on
s: - Current state which stores the field variables
Returns:
boolean

friendfactor

public double friendfactor(int week,
                           State s)
Calculates friend factor (how much friends effect their final decision)

Parameters:
week: - Number of week the simulation is on
s: - Current state which stores the field variables
Returns:
double

decision

public boolean decision(int week,
                        State s)
Calculates the final decision of the individual

Parameters:
week: - Number of week the simulation is on
s: - Current state which stores the field variables
Returns:
boolean